package net.muchine.test.ddd;

import org.springframework.beans.factory.annotation.Autowired;

public class EntryPoint {
	private final String identity;
	
	@Autowired private Registrar registrar;
	
	public EntryPoint(String identity) {
		this.identity = identity;
	}
	
	public String getIdentity() {
		return this.identity;
	}
	
	public EntryPoint persist() {
		this.registrar.add(this.getClass(), this);
		return this;
	}
}
